package com.song.ssm.mapper;

import com.song.ssm.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Author 宋伟宁
 * @Date 2023/10/11
 * @Version 1.0
 **/
public interface UserMapper {

    @Select("select * from t_user")
    List<User> findAll();

    @Insert("insert into t_user(username, password, sex, birthday)VALUES (#{username},#{password},#{sex},#{birthday})")
    int add(User user);

    @Delete("delete from  t_user where id=#{id}")
    int del(int id);

    @Update("update t_user set username=#{username},password=#{password},sex=#{sex},birthday=#{birthday} where id=#{id}")
    int update(User user);

    boolean batch_del(@Param("arr") String[] arr);
}
